I = imread('Lenna.jpg');

% Create a low-pass filter
h = fspecial('average', [5 5]);

% Apply the filter to the image using different padding options
J1 = imfilter(I, h, 0); % zero padding
J2 = imfilter(I, h, 'replicate'); % replicate border values
J3 = imfilter(I, h, 'symmetric'); % symmetric padding
J4 = imfilter(I, h, 'circular'); % circular padding

% Display the original and filtered images
figure;
subplot(2,3,1);
imshow(I);
title('Original Image');
subplot(2,3,2);
imshow(J1);
title('Zero Padding');
subplot(2,3,3);
imshow(J2);
title('Replicate Border Values');
subplot(2,3,4);
imshow(J3);
title('Symmetric Padding');
subplot(2,3,5);
imshow(J4);
title('Circular Padding');